<?php
/**
 * Created by PhpStorm.
 * User: krystal
 * Date: 2019/3/7
 * Time: 14:59
 */

namespace app\common\validate;


use think\Validate;

/**
 * 消息中心验证器
 * Class MessageCenter
 * @package app\common\validate
 */
class MessageCenter extends Validate
{

    protected $rule=[
        'type' => 'require|number|in:1,2',
        'ids' => 'require|min:1'
    ];

    protected $message=[
        'type.require' => '消息类型必须输入',
        'type.number' => '消息类型必须是数字',
        'type.in' => '消息不存在',
        'ids.require' => '消息id输入',
        'ids.min' => '消息不存在',
    ];

    protected $scene=[
        'all_read_message'=>[
            'type',
        ],
        'read_message'=>[
            'type',
            'ids'
        ],
        'del_message'=>[
            'type',
            'ids'
        ],
    ];

    protected $field=[
        'type' => '消息类型,系统或服务',
        'ids'=>'消息id,例如:1,2,3'
    ];
}